<template>
  <div id="app">
    <div class="layout" :class="{'layout-hide-text': spanLeft < 5}">
      <el-row type="flex">
        <el-col :span="spanLeft" class="layout-menu-left">
          <div>
            <navMenu></navMenu>
          </div>
        </el-col>
        <el-col :span="spanRight">
          <div class="layout-header">
            <el-button type="text"  @click="toggleClick" icon="menu"></el-button>
          </div>
          <div class="layout-content">
            <div class="layout-content-main">
              <router-view></router-view>
            </div>
          </div>
          <div class="layout-copy">
            2016-2017 &copy; TalkingData
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'app',
    components: {
      navMenu, headerBar
    },
    data () {
      return {
        spanLeft: 5,
        spanRight: 19
      }
    },
    computed: {
      iconSize () {
        return this.spanLeft === 5 ? 14 : 24;
      }
    },
    methods: {
      toggleClick () {
        if (this.spanLeft === 5) {
          this.spanLeft = 2;
          this.spanRight = 22;
        } else {
          this.spanLeft = 5;
          this.spanRight = 19;
        }
      }
    }
  }
</script>

<style>
  @import 'assets/css/common.css';
  /* reset */
  html {
    color: #000;
    background: #fff;
  }

  body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, input, button, textarea, p, blockquote, th, td {
    margin: 0;
    padding: 0;
  }

  body {
    font: 12px/1 Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif;
  }

  img {
    border: none;
  }

  em, strong {
    font-style: normal;
    font-weight: normal;
  }

  li {
    list-style: none;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 16px;
  }

  h3 {
    font-size: 14px;
  }

  h4, h5, h6 {
    font-size: 100%;
  }

  q:before, q:after {
    content: '';
  }

  /* 消除q前后的内容 */
  button, input, select, textarea {
    font-size: 100%;
  }

  /* 使得表单元素在 ie 下能继承字体大小 */
  input, button, textarea, select, optgroup, option {
    font-family: inherit;
    font-size: inherit;
    font-style: inherit;
    font-weight: inherit;
  }

  address, cite, dfn, em, var {
    font-style: normal;
  }

  /* 将斜体扶正 */
  font-family:

  "Microsoft YaHei"
  ,
  "Helvetica Neue"
  ,
  Helvetica,

  "PingFang SC"
  ,
  "Hiragino Sans GB"
  ,
  "微软雅黑"
  ,
  Arial, sans-serif

  ;

  /* link */
  a {
    text-decoration: none;
  }

  i {
    margin: 0 2px;
  }

  /* start */
  #app {
    display: flex;
    flex-flow: column;
    min-height: 100vh;
  }

  .main-body {
    flex: 1;
    overflow: hidden;
  }

  .main-body .body-left {
    height: 100%;
    overflow: hidden;
    padding-bottom: 9999px;
    margin-bottom: -9999px;
    background: #1f2d3d;
    border-radius: 0px;
  }

  .main-body .body-right {
    padding-top: 10px;
    padding-right: 24px;
  }

  footer {
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #1f2d3d;
    color: #bfcbd9;
  }

  /* float */
  .overflow-clear {
    overflow: auto;
  }

  .float-left {
    float: left;
  }

  .float-right {
    float: right;
  }

  .full-line {
    width: 100%;
  }

  .paging {
    margin-top: 16px;
    text-align: center;
  }

  .table-title-before {
    font-size: 20px;
    line-height: 2em;
    font-family: "Microsoft YaHei";
  }

  /* breadcrumb margin 4px */
  .breadcrumb-bottom {
    margin-bottom: 16px;
  }

  /*common style*/
  .max-width {
    width: 100% !important;
  }

  .mb-20 {
    margin-bottom: 20px;
  }

  .add-pd-26 {
    padding-left: 1.6em !important;
    padding-right: 1.6em !important;
  }

  .clear-a {
    text-decoration: none;
    color: #fff
  }

  .line {
    text-align: center;
  }
</style>
